﻿namespace Morus.Infrastructure
{
    using System;
    using System.Linq.Expressions;

    public sealed class DirectSpecification<T> : Specification<T>
        where T : class
    {
        private readonly Expression<Func<T, bool>> _matchingCriteria;

        public DirectSpecification(Expression<Func<T, bool>> matchingCriteria)
        {
            Check.Argument.IsNotNull(matchingCriteria, "matchingCriteria");

            _matchingCriteria = matchingCriteria;
        }

        public override Expression<Func<T, bool>> Expression
        {
            get
            {
                return _matchingCriteria;
            }
        }
    }
}
